{include file="head" /}

{include file="menu" /}

<!--main content start-->
      <section id="main-content">
          <section class="wrapper">
              <!--state overview start-->
              <button type="button" class="btn btn-primary " onclick="handle('backup')">数据备份</button>
              <!--state overview end-->
            <br><br>
             <div class="row">
                  <div class="col-lg-12">
                      <section class="panel">
                          <header class="panel-heading">
                             数据库列表
                          </header>
                          <table class="table table-striped table-advance table-hover">
                            <thead class="ordertable">
                              <tr>
                                <th>编号</th>
                                <th>时间</th>
                                <th>文件</th>
                                <th>操作</th>
                            </tr>
                          </thead>
                          <tbody>
                              <!-- {volist name="database" id="vo"} -->
                              <tr>
                                  <td>{$vo.id}</td>
                                  <td>{$vo.time} </td>
                                  <td>{$vo.filename}</td>
                                  <td>
                                     <a href="{:url('backupsbase',['tp'=>'dowonload','name'=>$vo.filename])}"><button class="btn btn-success btn-xs"><i class="icon-cloud-download"></i></button></a>
                                     <button class="btn btn-danger btn-xs" onclick="handle('del','{$vo.filename}')"><i class="icon-trash "></i></button>
                                     <!-- <button class="btn btn-primary btn-xs" onclick="handle('restore','{$vo.filename}')">还原</button> -->
                                  </td>
                              </tr>
                              <!-- {/volist} -->
                              
                              </tbody>
                          </table>
                      </section>
                  </div>
              </div>
              
           

          </section>
      </section>
      <!--main content end-->
  </section>

{include file="foot" /}
<script>
    function handle(tp,name=''){        
        if (tp){
            $.post("{:url('backupsbase')}",{tp:tp,name:name},function(response){
                if (response){
                    layer.msg(response, {icon: 1,time: 2000},function(){
                      window.location.href="{:Url('system/dbbase')}";
                    });
                }else{
                    layer.msg("操作失败，请重试!!", {icon: 2}); 
                }
    
            }); 
        }
    }


</script>